# use python 3
def generate_generator():
    current_id = 0
    def next_id():
        nonlocal current_id
        current_id += 1
        return current_id
    return next_id

generator_1 = generate_generator()
generator_2 = generate_generator()

print(generator_1())
print(generator_1())
print(generator_2())
print(generator_2())